var common = require('../common');
var store = common.store;
var getFile = common.getFile;
var data = {
  "result": "success",
  "messages": [],
  "fieldErrors": {},
  "errors": [],
  "data": {

  }
};
var data1 = {
  "result": "success",
  "messages": [],
  "fieldErrors": {},
  "errors": [],
  "data": false
};
module.exports = {
  // mock 请求
  "get /admin/km/list.do": function(req, res) {
    res.send({
      "result": "success",
      "messages": [],
      "fieldErrors": {},
      "errors": [],
      "data": {
        totalCount: 3, //总页数
        pageNo: 1, //当前页
        pageSize: 10, //每页显示的条数,
        listData: [{ //列表数据
          docSubject: "java问题", //标题
          rate: "90%", //答案数（准确率）
          visitNum: "100", //浏览量
          cateSubject: "java-线程问题", //类别
          docCreateTime: "2014-07-27", //创建时间
          id: "id_2001"

        }, { //列表数据
          docSubject: "java问题", //标题
          rate: "90%", //答案数（准确率）
          visitNum: "100", //浏览量
          cateSubject: "java-线程问题", //类别
          docCreateTime: "2014-07-27", //创建时间
          id: "id_2002"

        }, { //列表数据
          docSubject: "java问题", //标题
          rate: "90%", //答案数（准确率）
          visitNum: "100", //浏览量
          cateSubject: "java-线程问题", //类别
          docCreateTime: "2014-07-27", //创建时间
          id: "id_2003"

        }]
      }
    });
  },
  "get /admin/km/view.do": function(req, res) {
    res.send({
      "result": "success",
      "messages": [],
      "fieldErrors": {},
      "errors": [],
      "data": {
        docSubject: "java问题",
        cateIds: "ID2001_JAVA:ID2002_PHP", //多个分类id
        desc: "问题内容",
        descAnswer: "问题答案",
        infoLink: "信息来源"
      }
    });
  },
  "post /admin/km/save.do": function(req, res) {
    res.send(data);
  },
  "post /admin/km/delete.do": function(req, res) {
    res.send(data);
  },
  "post /admin/km/isReTitle.do": function(req, res) {
    res.send(data1);
  },
  "post /admin/km/isReDesc.do": function(req, res) {
    res.send(data1);
  }

};
